<template>
	<view>
		<!-- <yj-nav /> -->
		<u-parse :content="content" />
	</view>
</template>

<script>
	// import navConfig from './config/navConfig.js'
	import richTextConfig from './config/richTextConfig.js'

	export default {
		data() {
			return {
				// navConfig,
				richTextConfig,
				content: ''
			};
		},
		onLoad() {
			if (this.$yroute.query.type=='USER_AGREEMENT') {
				uni.setNavigationBarTitle({title:'用户协议' })
			} 
			if (this.$yroute.query.type=='PRIVACY_POLICY') {
				uni.setNavigationBarTitle({title:'隐私协议' })
			} 
			if (this.$yroute.query.type=='SERVE_AGREEMENT') {
				uni.setNavigationBarTitle({title:'商家协议' })
			} 
			if (!this.$yroute.query.type) {
				uni.setNavigationBarTitle({title:'关于企业' })
			} 
			// this.initNavigation(type)
		},
		mounted() {
			this.getRichText(this.$yroute.query.type?this.$yroute.query.type:'CORPORATE_VISION')
		},
		methods: {
			// initNavigation(type) {
			// 	switch (type) {
			// 		case 'USER_AGREEMENT':
			// 			this.navConfig.title = '用户协议'
			// 			break;
			// 		case 'PRIVACY_POLICY':
			// 			this.navConfig.title = '隐私政策'
			// 			break;
			// 	}
			// },
			// 根据类型修改标题
			
			// 获取富文本
			getRichText(type) {
				this.content = richTextConfig[type]
			}
		}
	}
</script>

<style lang="scss">

</style>